#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "calc.h"
#include <QString>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

Calc a;

void MainWindow::on_acButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.clear()));
}

void MainWindow::on_num00Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(-1)));
}

void MainWindow::on_num0Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(0)));
}

void MainWindow::on_num1Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(1)));
}


void MainWindow::on_num2Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(2)));
}


void MainWindow::on_num3Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(3)));
}


void MainWindow::on_num4Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(4)));
}


void MainWindow::on_num5Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(5)));
}


void MainWindow::on_num6Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(6)));
}


void MainWindow::on_num7Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(7)));
}


void MainWindow::on_num8Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(8)));
}


void MainWindow::on_num9Button_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.inputNum(9)));
}


void MainWindow::on_equalButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.calcNum(0)));
}


void MainWindow::on_plusButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.calcNum(1)));
}


void MainWindow::on_minusButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.calcNum(2)));
}


void MainWindow::on_multiButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.calcNum(3)));
}


void MainWindow::on_divideButton_clicked()
{
    ui->outcomeLabel->setText(QString::fromStdString(a.calcNum(4)));
}

